﻿<%@ Page Language="C#" %>

<% 
    if (Request.QueryString["btnUpdate"] != null && Request.QueryString["idHoaDon"] != null)
    {
        int idHoaDon = Int16.Parse(Request["idHoaDon"]);
        DTO.HoaDonDto hoadon = BUS.HoaDonBus.LayHoaDonTheoID(idHoaDon);

        Response.Write("<td colspan='9'><table align='center' border='1' cellpadding='4' cellspacing='0'><tr><td>Mã</td><td><input type='text' id='txtIDPill" + hoadon.ID + "' value='" + hoadon.ID + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Họ tên</td><td><input type='text' id='txtHoTen" + hoadon.ID + "' value='" + hoadon.HoTen + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Địa chỉ</td><td><input type='text' id='txtDiaChi" + hoadon.ID + "' value='" + hoadon.DiaChi + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Điện thoại</td><td><input type='text' id='txtDienThoai" + hoadon.ID + "' value='" + hoadon.DienThoai + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Email</td><td><input type='text' id='txtEmail" + hoadon.ID + "' value='" + hoadon.Email + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Tình trạng</td><td><select id='lstPillState" + hoadon.ID + "'><option value='-1'>Chưa xử lý</option><option value='0'>Đang giao</option><option value='1'>Đã nhận</option></select></td></tr>");
        Response.Write("<tr><td>Thành tiền</td><td><input type='text' id='txtThanhTien" + hoadon.ID + "' value='" + hoadon.GiaTri + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td>Ngày đặt hàng</td><td><input type='text' id='txtNgay" + hoadon.ID + "' value='" + hoadon.Ngay + "' readonly='true' class='readonlyField' /></td></tr>");
        Response.Write("<tr><td colspan='2' align='center'><input type='button' id='btnDoUpdate" + hoadon.ID + "' value='Cập nhật' onclick='DoUpdatePillState(" + hoadon.ID + ");'/>&nbsp;<input type='button' id='btnCloseUpdate" + hoadon.ID + "' value='Đóng' onclick='CloseDivUpdate(" + hoadon.ID + ");' /></td></tr>");
        Response.Write("</table></td>");
    }
    else
    {
        Response.Redirect("../Default.aspx");
    }     
%>